cmake_minimum_required(VERSION 3.0)
project(chap06)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include(FindPkgConfig)
pkg_check_modules(GLFW REQUIRED glfw3)

file(GLOB_RECURSE SRC_LIST ${CMAKE_SOURCE_DIR}/src/*.cpp)
file(GLOB_RECURSE INC_LIST ${CMAKE_SOURCE_DIR}/src/*.h)
add_executable(${CMAKE_PROJECT_NAME} ${SRC_LIST} ${INC_LIST})
target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/third/glad/src/glad.c)
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src)
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/third/glad/include)
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${GLFW_INCLUDE_DIRS})
target_link_directories(${CMAKE_PROJECT_NAME} PRIVATE ${GLFW_LIBRARY_DIRS})
target_link_libraries(${CMAKE_PROJECT_NAME} GL GLU glut dl X11 pthread Xrandr Xi
    ${GLFW_LIBRARIES}
    )
if(UNIX) 
target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -g)
else()
endif()




